/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;

/**
 *
 * @author lenovo
 */
public class ShowAlert {
    public static void ShowAlert(Display display, Form frm,String title, String msg, int type)
    {
        Alert al = new Alert(title, msg, null, AlertType.ERROR);
        switch(type)
        {
            case 0: 
                al.setType(AlertType.INFO);
                break;
            case 1: 
                al.setType(AlertType.WARNING);
                break;
            case 2: 
                al.setType(AlertType.ERROR);
                break;
        }
        al.setTimeout(Alert.FOREVER);
        display.setCurrent(al, frm);
    }
}
